package com.liangwj.springbootquickstart.annotation;

import java.lang.annotation.*;

/**
 * TODO: 学习spring的多数据源配置
 * TODO: 比较传统的spring做法,
 * <p>1. 在Spring注册多个数据源</p>
 * <p>2. 新建类继承AbstractRoutingDataSource，并配置</p>
 * <p>3. 给TheadLocal赋值 (需要AOP实现)</p>
 *      <li>3.1:在配置文件中开启spring AOP</li>
 *      <li>3.2:自定义注解</li>
 *      <li>3.3:切面逻辑</li>
 *      <li>3.4:添加注解</li>
 * @author Liangwenjun
 * @Date 2018-12-12
 * @version 1.0
 * @see com.liangwj.springbootquickstart.annotation.DataSource
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface DataSource {

    String value() default DS1;

    String DS1 = "dataSource1";

    String DS2 = "dataSource2";
}
